#include<iostream>
const int N = 1e6 + 10;
int a[N],f[N];
int n, m,kind;
using namespace std;
int main()
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	int left = 1, right = 1, begin = 1 ,len = n;
	while (right <= n)
	{
		if (f[a[right]]++ == 0) kind++;
		while (kind == m)
		{
			if (right - left + 1 < len)
			{
				begin = left;
				len = right - left + 1;
			}
			if (f[a[left]]-- == 1) kind--;
			left++;
		}
		right++;
	}
	cout << begin << " " << begin + len - 1 << endl;
	return 0;
}
//#include<iostream>
//using namespace std;
//int main()
//{
//	int a[4] = { 0,1,2,3 };
//	if (a[1]-- == 3) cout << "ni" << endl;
//	for (int i = 0; i < 4; i++)
//	{
//		cout << a[i] << ' ';
//	}
//	return 0;
//}